﻿using System;

class AreaOfTrapezoid
{
    static void Main()
    {
        int topSide;
        int bottomSide;
        int height;

        Console.WriteLine("Type top side of the trapezoid:");
        bool isTopSideNumber = int.TryParse(Console.ReadLine(), out topSide);
        Console.WriteLine("Type bottom side of the trapezoid:");
        bool isBottomSideNumber = int.TryParse(Console.ReadLine(), out bottomSide);
        Console.WriteLine("Type height of the trapezoid:");
        bool isHeightNumber = int.TryParse(Console.ReadLine(), out height);

        int area = (topSide+bottomSide)*height/2;

        if (isTopSideNumber && topSide > 0 && isBottomSideNumber && bottomSide > 0 && isHeightNumber && height>0)
        {
            Console.WriteLine("The area of the rectangle is {0}!", area);
        }
        else

        {
            Console.WriteLine("Your input isn`t OK!!!");
        }
    }
}